package com.sztx.pay.center.async.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;

import com.alibaba.dubbo.config.annotation.Service;
import com.sztx.pay.center.async.AsyncService;

@Service
public class AsyncServiceImpl implements AsyncService {

	private Logger logger = LoggerFactory.getLogger(AsyncServiceImpl.class);
	
	@Override
	@Async
	public void sayHello() {
		
//		try {
//			Thread.sleep(2000);
//		} catch (InterruptedException e) {
//			e.printStackTrace();
//		}
		
		asyncSayHello();
		
		logger.info("say hello");
	}

	@Override
	@Async
	public void asyncSayHello() {

		try {
			Thread.sleep(2000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		logger.info("say async hello");
	}

}
